package pers.cocoadel.springcloud.cloudgatewaygateway9527.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author ZhenWuWang
 */
//@Configuration
public class GatewayConfig
{
    @Bean
    public RouteLocator routeLocator(RouteLocatorBuilder builder)
    {
        return builder
                .routes()
                .route("baidu-locator", r -> r.path("/game")
                        .uri("http://news.baidu.com/game"))
                .route("baidu-locator2", r -> r.path("/guonei")
                        .uri("http://news.baidu.com/guonei"))
                .build();
    }
}
